<%@ page import="java.util.Date" %><%--
  Created by IntelliJ IDEA.
  User: 28064
  Date: 2022/3/19
  Time: 11:41
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>StayTime application</title>
</head>
<body>
<%
    Date now = new Date();
    response.setHeader("refresh","10");
%>
<p style="text-align: center;">登录时间为:<%=now%></p>
<form name="form1" method="post" action="">
    <div style="text-align: center;">
        <p><span style="font-size: large; color: #0000FF; ">您在本站已停留：</span></p>
        <p>
            <label>
                <input name="textarea" type="text" value="">
            </label>
        </p>
    </div>
    <script >
        var second=0;
        var minute=0;
        var hour=0;
        window.setTimeout("interval();",1000);
        function interval()
        {
            second++;
            if(second==60)
            {
                second=0;minute+=1;
            }
            if(minute==60)
            {
                minute=0;hour+=1;
            }
            document.form1.textarea.value = hour+"时"+minute+"分"+second+"秒";
            window.setTimeout("interval();",1000);

        }

    </script>
</form>
</body>
</html>
